package cn.jx.asc.common.enums;


@SuppressWarnings("unused")
public enum ResultStatus {
    /**
     * 前端状态枚举
     */
    SUCCESS(200, "请求成功"),
    CREATED(201, "创建成功"),
    DELETED(204, "删除成功"),
    MODIFIED(205, "修改成功"),
    FAILED(400, "请求失败"),
    PARAM_ERROR(401, "参数错误"),
    NEED_LOGIN(402, "未登录"),
    VISITED_FORBID(403, "权限不足"),
    NOT_FOUND(404, "请求的资源不存在"),
    METHOD_NOT_SUPPERED(405, "请求方式错误"),
    UNPROCESABLE_ENTITY(422, "发生一个验证错误"),
    SYSTEM_ERROR(500, "服务器内部错误"),

    /**
     * 用户状态枚举
     */
    USER_NOT_FOUND(100, "用户不存在"),
    WRONG_USER_NAME_OR_PASSWORD(101, "用户名或密码错误"),
    USER_DISABLE(102, "用户被禁用"),
    PASSWORD_ERROR(103, "密码错误"),
    ENETITY_FAILED(104, "实体校验失败"),
    TOKEN_ERROR(105, "用户访问令牌有误"),
    NOT_AUTHC(106, "用户未授权"),
    REGIST_STATUS(107,"用户为注册状态"),
    NOT_USERNAME(108,"用户名为空"),
    USERNAME_EXISTS(109,"用户名已存在"),
    EMPLOYEE_NUMBER_EXISTS(110,"职工号已存在"),
    NOT_EMPLOYEE_NUMBER(111,"职工号为空"),
    NOT_USERNAME_PASSWORD(112,"用户名或密码为空"),
    PASSWORD_LENGTH_IS_WRONG(113,"密码太长或太短"),
    INCONSISTENT_PASSWORDS(114,"密码不一致"),
    REAL_NAME_IS_EMPTY(115,"真实姓名不能为空"),
    USER_IS_NOT_ACTIVATED(116, "用户未激活"),
    INSECURE_PASSWORD(117, "密码不安全"),
    NOT_PASSWORD(118, "密码不能为空"),
    NOT_ID(119, "id不能为空"),


    /**
     * onenet数据相关
     */
    PIPE_REFUSE(150,"远程拒绝控制连接"),
    WARING_THRESHOLD(151,"报警阈值设置失败"),
    HEIGHT_THRESHOLD(152,"液面上下限阈值设置失败"),
    CONFIR_WARING(153,"通知失败");



    private final Integer code;
    private final String msg;

    /**
     * 结果对象
     * @param code 状态码
     * @param msg 消息体
     */
    ResultStatus(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

}
